import java.util.Arrays;

/**
 * 写字符串需要的行数
 *
 * @USER: Administrator
 * @DATE: 2024/9/15 上午10:00
 * @VERSION: 1.0.0
 */
public class LC806 {
    public static void main(String[] args) {
        int[] widths = new int[26];
        Arrays.fill(widths,10);
        String s = "abcdefghijklmnopqrstuvwxyz";
        LC806 lc806 = new LC806();
        System.out.println(Arrays.toString(lc806.numberOfLines(widths, s)));
    }
    public int[] numberOfLines(int[] widths, String s) {
        int[] result = new int[2];
        int digits = 0;
        int lines = 0;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (digits+widths[c-'a']>100){
                digits = widths[c-'a'];
                lines++;
            }else {
                digits+=widths[c-'a'];
            }
        }
        result[0] = lines+1;
        result[1] = digits;
        return result;
    }
}
